from race.Player import *
import logging.config
from threading import Thread

logging.config.fileConfig('./util/logging.conf')
log = logging.getLogger("example")

"""
    子类描述：
        1、贼类
"""


class ktThief(Player):

    # 狂徒贼的5颗星星自动识别的方式
    def a(self):
        self.AOE = False
        self.startScheduler1()  # 调用 CallBackScheduler1
        self.startScheduler2()  # 调用 CallBackScheduler2
        self.startScheduler3()  # 调用 CallBackScheduler3
        # self.startScheduler4()  # 调用 CallBackScheduler4
        self.startScheduler5()  # 调用 CallBackScheduler5
        return

    def q(self):
        self.AOE = True
        self.startScheduler4()  # 调用 CallBackScheduler4
        self.startScheduler1()  # 调用 CallBackScheduler1
        self.startScheduler2()  # 调用 CallBackScheduler2
        self.startScheduler3()  # 调用 CallBackScheduler3
        self.startScheduler5()  # 调用 CallBackScheduler5
        return

    def CallBackScheduler4(self):
        while self.ui.stopLoop == False:
            # # 剑刃乱舞
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.GREEN, 'big', '5', 0.06, 6, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # 保持切割(3*)
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X3, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.GREEN, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 3星
                self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WA_SQUARE_ZFX_AvgColor,
                                                  self.GREEN, 'small', '7', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

    def CallBackScheduler3(self):
        while self.ui.stopLoop == False:
            # # 手枪射击
            # self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X3, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
            #                                   self.WA_SQUARE_ZFX_AvgColor,
            #                                   self.RED, 'big', '3', 0.06, 2,self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # # 剑刃乱舞 55555 ?????
            # self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
            #                                 self.WABloodBarDeltaY,
            #                                 self.WA_SQUARE_ZFX_AvgColor,
            #                                 self.GREEN, 'big', '5', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # # 正中眉心a
            # avgColorNumber = self.pubAvgColorNoTrigger(1524, self.WABloodBarY, self.WABloodBarDeltaX + 7,
            #                                            self.WABloodBarDeltaY, self.GREEN, 0.06)
            # if avgColorNumber > self.WABloodBarAvgColor:
            #     #5星
            #     self.pubAvgColorTiggerKeyCDMode(184, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
            #                                     self.WA_SQUARE_ZFX_AvgColor,
            #                                     self.GREEN, 'big', '8', 0.06, 2,self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            #
            # # 斩击b
            # avgColorNumber = self.pubAvgColorNoTrigger(1524, self.WABloodBarY, self.WABloodBarDeltaX + 7,
            #                                            self.WABloodBarDeltaY, self.GREEN, 0.06)
            # if avgColorNumber > self.WABloodBarAvgColor:
            #     # 5星
            #     for i in range(0, 2):
            #         self.click(self.kb, '6', 3)

            # 骰子
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X8, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.GREEN, 'big', '4', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # 狂热鞭挞(3*)
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X3, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.GREEN, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X5, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                self.WABloodBarDeltaY,
                                                self.WA_SQUARE_ZFX_AvgColor,
                                                self.GREEN, 'big', '9', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # pvp饰品1
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X7, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.GREEN, 'big', 'p', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # pvp饰品2
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X7, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.GREEN, 'big', '[', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # 血量低于xx多少，触发开启加血，瓶子
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.8, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'k', 0.06, 2, self.ELSEKEY_1, self.DEBUG_CLOSE)

            # 血量低于xx多少，触发开启佯攻，减伤
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.7, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'n', 0.06, 2, self.ELSEKEY_1, self.DEBUG_CLOSE)

    def on_mouse_click_son_before_thread(self, x, y, button, pressed):
        # 在鼠标点击，终止和打断其他动作（有些职业需要，有些不需要）??????????
        pass
        return

    def CallBackScheduler1(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:

            # 影袭（赚星）
            self.click(self.kb, '1', 2)

            # 手枪射击
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X3, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.GREEN, 'big', '3', 0.06, 4, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # 斩击b
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X4, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.GREEN, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 4星 斩击
                for i in range(0, 5):
                    self.click(self.kb, '6', 3)
            else:
                # 影袭（赚星）
                self.click(self.kb, '1', 2)

            # # 正中眉心a
            # avgColorNumber = self.pubAvgColorNoTrigger(1475, self.WABloodBarY, self.WABloodBarDeltaX + 7,
            #                                            self.WABloodBarDeltaY, self.GREEN, 0.06)
            # if avgColorNumber > self.WABloodBarAvgColor:
            #     # 4星
            #     self.pubAvgColorTiggerKeyCDMode(184, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
            #                                     self.WA_SQUARE_ZFX_AvgColor,
            #                                     self.GREEN, 'big', '8', 0.06, 2,self.ELSEKEY_1 ,self.DEBUG_CLOSE)
        return

    def CallBackScheduler2(self):
        while self.ui.stopLoop == False:
            # 斩击b
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X4, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.GREEN, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 4星 正中眉心a
                self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X4, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                self.WABloodBarDeltaY,
                                                self.WA_SQUARE_ZFX_AvgColor,
                                                self.GREEN, 'big', '8', 0.06, 5, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
                # 4星 斩击
                for i in range(0, 5):
                    self.click(self.kb, '6', 3)
            else:
                # 影袭（赚星）
                self.click(self.kb, '1', 2)
            sleep(0.1)

        return

    def CallBackScheduler5(self):
        while self.ui.stopLoop == False:
            # pvp饰品1
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X7, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', 'p', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # 种族天赋
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X6, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', 'o', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # 狂热鞭挞
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X5, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', '9', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # boss战前，自动在小怪阶段全部开DPS的大招
            if self.ui.checkBox_SM_Jump2Wolf.isChecked() == True:
                self.click(self.kb, 'i', 2)
                self.click(self.kb, '[', 2)

    def mouseUp(self, x, y):

        for i in range(1, 6):
            self.click(self.kb, 'i', 2)
            sleep(0.1)
            self.click(self.kb, 'o', 2)
            sleep(0.1)
            self.click(self.kb, '9', 2)
            sleep(0.1)
            self.click(self.kb, '[', 2)
            sleep(0.1)
        return

    def mouseDown(self, x, y):
        for i in range(1, 4):
            self.click(self.kb, 'n', 2)
            sleep(0.1)
        return

    def x(self):
        # 打断施法
        for i in range(1, 6):
            self.click(self.kb, 't', 2)
            sleep(0.1)

        # 打断后的继续
        if self.AOE == False:
            self.click(self.kb, 'a', 1)
        else:
            self.click(self.kb, 'q', 1)
        return

    def w(self):
        for i in range(1, 4):
            self.click(self.kb, 'n', 2)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'a', 1)
        return


class mrThief(Player):

    # 敏锐贼的5颗星星自动识别的方式
    def a(self):
        self.AOE = False
        self.kb.press('`')  # 触发-->parallel1
        self.kb.release('`')

        self.kb.press(Key.alt_l)  # 触发-->parallel1
        self.kb.release(Key.alt_l)

        while self.ui.stopLoop == False:
            # # 保持切割(3*)
            # avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X3, self.WA_STAR_Y, self.WABloodBarDeltaX,
            #                                            self.WABloodBarDeltaY, self.GREEN, 0.06)
            # if avgColorNumber > self.WABloodBarAvgColor:
            #     # 3星
            #     # 切割
            #     self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
            #                                       self.WABloodBarDeltaY,
            #                                       self.WA_SQUARE_ZFX_AvgColor,
            #                                       self.GREEN, 'small', '6', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            #     # 割裂
            #     self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
            #                                     self.WABloodBarDeltaY,
            #                                     self.WA_SQUARE_ZFX_AvgColor,
            #                                     self.GREEN, 'big', '2', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # else:
            #     # 背刺（赚星）
            #     self.click(self.kb, '1', 2)

            # 血量低于xx多少，触发开启加血，瓶子
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.8, self.WABloodBarY,
                                                  self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'k', 0.06, 2,
                                                  self.ELSEKEY_1, self.DEBUG_CLOSE)

            # 血量低于xx多少，触发开启佯攻，减伤
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.7, self.WABloodBarY,
                                                  self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'n', 0.06, 2,
                                                  self.ELSEKEY_1, self.DEBUG_CLOSE)

            # 暗影之舞
            # if self.TimeSecondModZero(2):
            self.click(self.kb, '5', 1)

            # # 血腥狂怒
            # self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X4, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
            #                                 self.WABloodBarDeltaY,
            #                                 self.WA_SQUARE_ZFX_AvgColor,
            #                                 self.GREEN, 'big', 'o', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # 血腥狂怒
            if self.TimeSecondModZero(3):
                self.click(self.kb, 'o', 1)

            # 死亡符记
            # if self.TimeSecondModZero(2):
            self.click(self.kb, '[', 1)

            # # 狂热鞭挞
            # self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X3, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
            #                                 self.WABloodBarDeltaY,
            #                                 self.WA_SQUARE_ZFX_AvgColor,
            #                                 self.RED, 'big', '4', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # 狂热鞭挞
            # if self.TimeSecondModZero(2):
            self.click(self.kb, '4', 1)

    def on_mouse_click_son_before_thread(self, x, y, button, pressed):
        # 在鼠标点击，终止和打断其他动作（有些职业需要，有些不需要）??????????
        pass
        return

    def parallel1(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:
            # 刺骨
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X5, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.GREEN, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 5星 刺骨
                for i in range(0, 4):
                    self.click(self.kb, '8', 3)
            else:
                # 背刺（赚星）
                self.click(self.kb, '1', 2)

            # # 割裂
            # avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X3, self.WA_STAR_Y, self.WABloodBarDeltaX,
            #                                            self.WABloodBarDeltaY, self.GREEN, 0.06)
            # if avgColorNumber > self.WABloodBarAvgColor:
            #     # 3星 割裂
            #     self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
            #                                     self.WABloodBarDeltaY,
            #                                     self.WA_SQUARE_ZFX_AvgColor,
            #                                     self.GREEN, 'big', '2', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # else:
            #     # 背刺（赚星）
            #     self.click(self.kb, '1', 2)
            sleep(0.1)
        return

    def parallelAlt2(self):
        while self.ui.stopLoop == False:
            # 保持切割(3*)
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X3, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.RED, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 3星
                # 切割
                self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WA_SQUARE_ZFX_AvgColor,
                                                  self.RED, 'small', '6', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
                # # 割裂
                # self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                #                                 self.WABloodBarDeltaY,
                #                                 self.WA_SQUARE_ZFX_AvgColor,
                #                                 self.RED, 'big', '2', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            else:
                # 背刺（赚星）
                self.click(self.kb, '1', 2)

            # 保持割裂(2*) 3->2
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X2, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.RED, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 3星
                # # 切割
                # self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                #                                   self.WABloodBarDeltaY,
                #                                   self.WA_SQUARE_ZFX_AvgColor,
                #                                   self.RED, 'small', '6', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
                # 割裂
                self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                self.WABloodBarDeltaY,
                                                self.WA_SQUARE_ZFX_AvgColor,
                                                self.RED, 'big', '2', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            else:
                # 背刺（赚星）
                self.click(self.kb, '1', 2)

            sleep(0.1)

        return

    def x(self):
        for i in range(1, 4):
            self.click(self.kb, 't', 2)
            sleep(0.1)

        # 打断后的继续
        if self.AOE == False:
            self.click(self.kb, 'a', 1)
        else:
            self.click(self.kb, 'q', 1)
        return

    def mouseUp(self, x, y):
        # 开爆发
        for i in range(1, 6):
            self.click(self.kb, '4', 2)
            sleep(0.2)

        return

    def q(self):

        # 袖剑旋风
        self.click(self.kb, '9', 4)

        self.AOE = True
        while self.ui.stopLoop == False:

            # 保持切割(3*)
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X3, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.RED, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 3星
                self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WA_SQUARE_ZFX_AvgColor,
                                                  self.RED, 'small', '6', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            else:
                # 背刺（赚星）
                self.click(self.kb, '3', 2)

            # 黑火药
            avgColorNumber = self.pubAvgColorNoTrigger(self.WA_STAR_X4, self.WA_STAR_Y, self.WABloodBarDeltaX,
                                                       self.WABloodBarDeltaY, self.RED, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # 黑火药（销号星星）
                self.click(self.kb, '7', 2)
            else:
                # 肩袖风暴（赚星）
                self.click(self.kb, '3', 2)

            # 血量低于xx多少，触发开启加血，瓶子
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.8, self.WABloodBarY,
                                                  self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.RED, 'small', 'k', 0.06, 2,
                                                  self.ELSEKEY_1, self.DEBUG_CLOSE)

            # 血量低于xx多少，触发开启佯攻，减伤
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.7, self.WABloodBarY,
                                                  self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.RED, 'small', 'n', 0.06, 2,
                                                  self.ELSEKEY_1, self.DEBUG_CLOSE)

            # 狂热鞭挞
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X3, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', '4', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

            # 血腥狂怒
            self.pubAvgColorTiggerKeyCDMode(self.WA_SQUARE_ZFX_X4, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                            self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', 'o', 0.06, 2, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # 暗影之舞
            self.click(self.kb, '5', 1)

            self.click(self.kb, '[', 1)

    def mouseDown(self, x, y):
        for i in range(1, 6):
            self.click(self.kb, 'n', 2)
            sleep(0.2)
        return

    def w(self):
        for i in range(1, 4):
            self.click(self.kb, 'n', 2)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'a', 1)
        return

    def c(self):
        # 冲锋，暗影步
        for i in range(1, 4):
            self.click(self.kb, '.', 2)
            sleep(0.1)

        # 暗影步的继续
        # if self.AOE == False:
        #     self.click(self.kb, 'a', 1)
        # else:
        #     self.click(self.kb, 'q', 1)
        return

    def v(self):
        # 打球
        # for i in range(1, 2):
        #     self.click(self.kb, 'b', 2)
        #     sleep(0.1)
        self.click(self.kb, 'b', 2)
        # super().z()
        return


class tbcThief1(Player):
    # 新开的怀旧服的盗贼练级

    # 狂徒贼的5颗星星自动识别的方式
    def a(self):
        self.kb.press('`')  # 触发-->parallel1
        self.kb.release('`')

        # loopCount = 0
        # while True:
        #     loopCount = loopCount + 1
        #     log.debug("ImageGrab图像抓取，像素识别前时分秒:" + str(datetime.datetime.now()))
        #     sleep(0.8)  # 避免CPU占用太高
        #     ################################FiveStart##########################################
        #     catchFiveStartX = 873  # 抓取FiveStart的X起始位置
        #     catchFiveStartY = 416  # 抓取FiveStart的Y起始位置
        #     imFiveStart = ImageGrab.grab(
        #         bbox=(catchFiveStartX, catchFiveStartY, catchFiveStartX + self.NugComboBarDeltaX,
        #               catchFiveStartY + self.NugComboBarDeltaY))  # X1,Y1,X2,Y2
        #     imFiveStart_numpy = np.array(imFiveStart.getdata(), dtype='uint8').reshape(
        #         (imFiveStart.size[1], imFiveStart.size[0], 3))
        #     imFiveStart_pil = Image.fromarray(imFiveStart_numpy)
        #     rFiveStart, gFiveStart, bFiveStart = imFiveStart_pil.split()  # 分离三通道
        #     bFiveStart.thumbnail((1, 1))  # 图片缩放为一个像素点
        #     avgFiveStart_color = bFiveStart.getpixel((0, 0))
        #     ################################Button1##########################################
        #     catchButton1X = 699  # 抓取FiveStart的X起始位置
        #     catchButton1Y = 1052  # 抓取FiveStart的Y起始位置
        #     imButton1 = ImageGrab.grab(
        #         bbox=(catchButton1X, catchButton1Y, catchButton1X + self.Button1DeltaX,
        #               catchButton1Y + self.Button1DeltaY))  # X1,Y1,X2,Y2
        #     imButton1_numpy = np.array(imButton1.getdata(), dtype='uint8').reshape(
        #         (imButton1.size[1], imButton1.size[0], 3))
        #     imButton1_pil = Image.fromarray(imButton1_numpy)
        #     rButton1, gButton1, bButton1 = imButton1_pil.split()  # 分离三通道
        #     gButton1.thumbnail((1, 1))  # 图片缩放为一个像素点
        #     avgButton1_color = gButton1.getpixel((0, 0))
        #     ################################End##########################################
        #     if avgFiveStart_color > 200:  # 平均像素值的一个判断
        #         # 满5颗星，需要执行的终结技
        #         for i in range(1, 7):
        #             if loopCount % 7 == 0:
        #                 self.click(self.kb, '7', 4)
        #             else:
        #                 # self.click(self.kb, '1', 4)
        #                 self.click(self.kb, '6', 4)
        #             sleep(0.2)
        #     else:
        #         self.click(self.kb, '5', 2)
        #
        #     if avgButton1_color > 140:
        #         for i in range(1, 7):
        #             self.click(self.kb, '4', 3)
        #             sleep(0.2)
        #
        #     log.debug("ImageGrab图像抓取，像素识别后时分秒:" + str(datetime.datetime.now()))

    def on_mouse_click_son_before_thread(self, x, y, button, pressed):
        # 在鼠标点击，终止和打断其他动作（有些职业需要，有些不需要）??????????
        pass
        return

    def parallel1(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        for i in range(1, 888888):
            sleep(0.3)
            self.click(self.kb, '1', 3)
            sleep(0.3)
            # self.click(self.kb, '3', 3)
        return

    def parallelAlt2(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:
            self.click(self.kb, '2', 3)
            sleep(0.3)
            self.click(self.kb, '2', 3)
        return


if __name__ == '__main__':
    pass
